//
//  MFAdxSplash.h
//  IMMonetization
//
//  Created by pillow on 2025/8/11.
//  Copyright © 2025 MFAdxSDK. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN

@protocol MFAdxSplashDelegate;

@interface MFAdxSplash : NSObject

//初始化开屏广告
- (instancetype)initWithSlotID:(NSString *)slotID;

//可选，拉取广告超时时间，默认为5秒
@property (nonatomic, assign) double fetchDelay;

//必选，接收回调的代理
@property (nonatomic, weak) id<MFAdxSplashDelegate> delegate;

//开始请求广告
- (void)loadAdData;

//返回广告是否可展示
//当广告已经加载完成&&未曝光&&未过期时，为YES，否则为NO
- (BOOL)isAdValid;

//广告的eCPM，单位：分 在mfadx_splashAdDidLoad回调后可以调用
- (NSInteger)eCPM;

//竞价成功时上报接口
- (void)sendWinNotice;

//竞价失败时上报接口
//winPrice 胜出者价格 单位分
//winBidder 胜出者 （非必填）传递字符串为  @"chuanshanjia"、@"guangdiantong"、@"baidu"、@"other"
//info 其它信息 （非必填）比如广告标题、是否曝光、是否点击 @{@"adTitle":@"广告标题",@"adShow":@"1",@"adClick":@"1"}
- (void)sendLossNoticeWithwinnerPirce:(NSInteger)winPrice winBidder:(NSString *)bidder otherInfo:(NSDictionary *)info;

//展示广告  viewController用来presentViewController:animated:YES completion:展示广告控制器
- (void)showAdWithViewController:(UIViewController *)viewController bottomView:(UIView * _Nullable)bottomView;

//可以获取本次请求的requestID，通过requestID可获取该次广告的上报情况，仅用于测试阶段
-(NSString*)getRequestID;
@end


@protocol MFAdxSplashDelegate <NSObject>

@optional
//广告加载完成
- (void)mfadx_splashAdDidLoad:(MFAdxSplash *)splashAd;

//广告加载失败
- (void)mfadx_splashAd:(MFAdxSplash *)splashAd didFailWithError:(NSError *)error;

//开屏广告曝光回调
- (void)mfadx_splashAdExposured:(MFAdxSplash *)splashAd;

//广告被点击
- (void)mfadx_splashAdDidClick:(MFAdxSplash *)splashAd;

//广告即将被关闭
- (void)mfadx_splashAdWillClose:(MFAdxSplash *)splashAd;

//广告已经被关闭
- (void)mfadx_splashAdDidClose:(MFAdxSplash *)splashAd;

//用户点击了跳过按钮
- (void)mfadx_splashAdDidClickSkip:(MFAdxSplash *)splashAd;

@end

NS_ASSUME_NONNULL_END
